<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>
if (window.internals)
  internals.settings.setEditingBehavior('win');

selection_test(
  '<div contenteditable dir="ltr">|    אבצ    דעפ    abc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6 |   \u05D3\u05E2\u05E4    abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '8-0 right word');

selection_test(
  '<div contenteditable dir="ltr"> |   אבצ    דעפ    abc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6 |   \u05D3\u05E2\u05E4    abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '8-1 right word');

selection_test(
  '<div contenteditable dir="ltr">  |  אבצ    דעפ    abc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6 |   \u05D3\u05E2\u05E4    abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '8-2 right word');

selection_test(
  '<div contenteditable dir="ltr">   | אבצ    דעפ    abc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6 |   \u05D3\u05E2\u05E4    abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '8-3 right word');

selection_test(
  '<div contenteditable dir="ltr">    |אבצ    דעפ    abc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6 |   \u05D3\u05E2\u05E4    abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '8-4 right word');

selection_test(
  '<div contenteditable dir="ltr">    א|בצ    דעפ    abc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6 |   \u05D3\u05E2\u05E4    abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '8-5 right word');

selection_test(
  '<div contenteditable dir="ltr">    אב|צ    דעפ    abc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6 |   \u05D3\u05E2\u05E4    abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '8-6 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ|    דעפ    abc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6 |   \u05D3\u05E2\u05E4    abc   def   חיח    ופק    </div>',
  '8-7 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ |   דעפ    abc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4 |   abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '8-8 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ  |  דעפ    abc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4 |   abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '8-9 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ   | דעפ    abc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4 |   abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '8-10 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    |דעפ    abc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4 |   abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '8-11 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    ד|עפ    abc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4 |   abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '8-12 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דע|פ    abc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4 |   abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '8-13 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ|    abc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4 |   abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '8-14 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ |   abc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc |  def   חיח    ופק    </div>',
  '8-15 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ  |  abc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc |  def   חיח    ופק    </div>',
  '8-16 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ   | abc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc |  def   חיח    ופק    </div>',
  '8-17 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    |abc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc |  def   חיח    ופק    </div>',
  '8-18 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    a|bc   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc |  def   חיח    ופק    </div>',
  '8-19 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    ab|c   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc |  def   חיח    ופק    </div>',
  '8-20 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc|   def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    abc |  def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '8-21 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc |  def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def |  חיח    ופק    </div>',
  '8-22 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc  | def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def |  חיח    ופק    </div>',
  '8-23 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   |def   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def |  חיח    ופק    </div>',
  '8-24 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   d|ef   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def |  חיח    ופק    </div>',
  '8-25 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   de|f   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def |  חיח    ופק    </div>',
  '8-26 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def|   חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    abc   def |  \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7    </div>',
  '8-27 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def |  חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    abc   def   \u05D7\u05D9\u05D7 |   \u05D5\u05E4\u05E7    </div>',
  '8-28 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def  | חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    abc   def   \u05D7\u05D9\u05D7 |   \u05D5\u05E4\u05E7    </div>',
  '8-29 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   |חיח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    abc   def   \u05D7\u05D9\u05D7 |   \u05D5\u05E4\u05E7    </div>',
  '8-30 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   ח|יח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    abc   def   \u05D7\u05D9\u05D7 |   \u05D5\u05E4\u05E7    </div>',
  '8-31 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   חי|ח    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    abc   def   \u05D7\u05D9\u05D7 |   \u05D5\u05E4\u05E7    </div>',
  '8-32 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   חיח|    ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   \u05D7\u05D9\u05D7 |   \u05D5\u05E4\u05E7    </div>',
  '8-33 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   חיח |   ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7|    </div>',
  '8-34 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   חיח  |  ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7|    </div>',
  '8-35 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   חיח   | ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7|    </div>',
  '8-36 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   חיח    |ופק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7|    </div>',
  '8-37 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   חיח    ו|פק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7|    </div>',
  '8-38 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   חיח    ופ|ק    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    \u05D0\u05D1\u05E6    \u05D3\u05E2\u05E4    abc   def   \u05D7\u05D9\u05D7    \u05D5\u05E4\u05E7|    </div>',
  '8-39 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   חיח    ופק|    </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   חיח    ופק|    </div>',
  '8-40 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   חיח    ופק |   </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   חיח    ופק|    </div>',
  '8-41 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   חיח    ופק  |  </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   חיח    ופק|    </div>',
  '8-42 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   חיח    ופק   | </div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   חיח    ופק|    </div>',
  '8-43 right word');

selection_test(
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   חיח    ופק    |</div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable dir="ltr">    אבצ    דעפ    abc   def   חיח    ופק|    </div>',
  '8-44 right word');
</script>
